<?php
class payment{
	public function init($params=array()){
		$this->db=$this->yum->library('mysql');
		$this->prefix=$this->yum->vars('app','prefix');
	}
    public function GPayment($params=array()){
    	return $this->db->select($this->prefix.'payment AS A',$params);
    }
    public function GPaymentFull($params=array()){
    	$table=$this->prefix.'payment AS A';
    	$table.=' JOIN '.$this->prefix.'member AS B ON A.member=B.id';
    	if(!isset($params['select'])){
    		$params['select']='A.id,B.mail,A.member,A.date,A.type,A.company,A.subbranch,A.province,A.city,A.account,A.name,A.deduction,A.tax,A.outlay,A.fact,A.locked';
    	}
    	return $this->db->select($table,$params);
    }
	public function IPayment($params){
		return $this->db->insert($this->prefix.'payment',$params);
	}
	public function UPayment($params){
		return $this->db->update($this->prefix.'payment',$params);
	}
}
?>